package cn.tedu.spring.eg3;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@Component
public class shopController {
    private String name;

    public shopController() {
        System.out.println("1实例化[无参构造]");
    }
    @Value("测试")
    public void setName(String name) {
        System.out.println("2注入[setter]");
    }
    @PostConstruct
    public void init(){
        System.out.println("3初始化[init-method]");
    }
    @PreDestroy
    public void destroy(){
        System.out.println("5销毁[destroy-method]");
    }
}
